package com.hs.utils;

import java.io.InputStream;
import java.util.Properties;

public class Password {
    private static Properties properties;
    static{
        try{
            //加载属性文件
            properties = new Properties();
            InputStream in = Password.class.getClassLoader().getResourceAsStream("password.properties");
            properties.load(in);
        }catch (Exception e){
            e.printStackTrace();
            System.out.println("密码属性文件加载失败");
        }
    }

    /**
     * 获取学生默认密码
     * @return
     */
    public static String readerDefaultPassword(){
        return properties.getProperty("reader.password");
    }

    /**
     * 获取教师默认密码
     * @return
     */
    public static String staffDefaultPassword(){
        return properties.getProperty("staff.password");
    }
}
